package queue;

import org.junit.Test;

import java.util.PriorityQueue;

/**
 * PriorityQueue默认是小顶堆，如果要改成大顶堆，需要重新实现compareTo方法
 * @Author tuyou_cd
 * @Date 2020/8/19 14:24
 */
public class PriorityQueueTest {

    @Test
    public void addTest() {
        PriorityQueue queue = new PriorityQueue(1);
        System.out.println(queue.add(1));
        System.out.println(queue.add(2));

        System.out.println(queue.poll());
        System.out.println(queue.poll());
    }
}
